package work.huangxin.share.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import work.huangxin.share.domain.manhe.Manhe;
import work.huangxin.share.mapper.ManheMapper;
import work.huangxin.share.service.AdminManHeService;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: chaoooos
 * @Date: 2023-05-16 17:15
 * @Desc:
 */
@Service
public class AdminManHeServiceImpl implements AdminManHeService {

    @Resource
    private ManheMapper manheMapper;

    @Override
    public PageInfo<Manhe> selectPageUserList(Manhe manhe, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<Manhe> manheList = manheMapper.selectPageUserList(manhe);
        return PageInfo.of(manheList);
    }

    @Override
    public Manhe getDetail(Long id) {
        Manhe manhe = manheMapper.getDetail(id);
        return manhe;
    }

    @Override
    public int deleteManHeById(Long id) {
        return manheMapper.deleteById(id);
    }

    @Override
    public int addManHe(Manhe manhe) {
        return manheMapper.addManHe(manhe);
    }


}
